using System;
using System.Drawing;
using Diagram.View;

namespace PetriDiagram.Shapes
{
    [Serializable]
    public class InhibitorShape : ConnectionShape
    {
        public override void Draw(Graphics g)
        {
            const int HEAD_RADIUS = 8;
            
            base.Draw(g);

            Point endPoint = Handles[ Handles.Count - 1 ].Location;

            RectangleF headRect = new RectangleF( endPoint.X - HEAD_RADIUS / 2,
                                                  endPoint.Y - HEAD_RADIUS / 2,
                                                  HEAD_RADIUS,
                                                  HEAD_RADIUS );

            g.FillEllipse(Brushes.White, headRect);
            g.DrawEllipse( Pens.Black, headRect );
        }

        public override Shape Clone()
        {
            return new InhibitorShape();
        }
    }
}
